package cn.monkey.family.server.domain.uc.auth.wechat;

import cn.monkey.family.data.Result;
import cn.monkey.family.data.context.Context;
import cn.monkey.family.data.context.RequestContext;
import cn.monkey.family.data.uc.auth.wechat.WechatPhoneNoDecodeRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wechat")
public class WechatController {
    final IWechatService wechatService;

    public WechatController(IWechatService wechatService) {
        this.wechatService = wechatService;
    }

    @PostMapping("phoneNo")
    Result<?> decodePhoneNo(@Context RequestContext requestContext,
                            @RequestBody WechatPhoneNoDecodeRequest request) {
        return wechatService.decodePhoneNo(requestContext, request);
    }
}
